import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 根据查询移库单号所有
export const customerDetail = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryDetails`, { params });

// export const customerDetail = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryDetails`, { params });
// 仓库下拉框，其他的
export const Storage = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/Storage/Select`, { params });
// 仓库下拉框，其他的
export const getAllModel = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/Storage/Select`, { params });
// 查询备件库存信息，点击新增弹框查询的数据
export const StockParts = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryPartItem`, { params });
// 查询备件库存明细
export const StockItem = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryPartItemInfos/${params.PART_NO}/${params.STORAGE_CODE}`, { params });
// 点击保存，保存移库单和明细
export const save = params => axios.post(`${SERVER.DMSCLOUD_PART}/partMove/addPartItemMove`, params);
// 根据备件移库工单号查询 单子上的移库备件详细
export const queryPartInfos = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryPartInfos`, { params });
// 根据备件移库工单号出库 单子上的移库备件详细
export const outStorage = params => axios.post(`${SERVER.DMSCLOUD_PART}/partMove/partOutStorage/${params.transferNo}`, params);
// 根据备件移库工单号作废
export const cancelMoveOrder = params => axios.delete(`${SERVER.DMSCLOUD_PART}/partMove/delPartItemMove/${params.transferNo}`, params);
// 根据备件代码和仓库代码查询可用库位
export const queryUsableLocations = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryLocations`, { params });
// 根据备件移库工单号删除
export const delMoveOrder = params => axios.delete(`${SERVER.DMSCLOUD_PART}/partMove/deletePartItemMove/${params.transferNo}`, params);
// 查询原仓库可以移库得备件信息
export const queryUsablePartInfos = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryPartStockItem/${params.oldStorageCode}/${params.newStorageCode}`, { params });
// 判断旧仓库的备件能否移动到新仓库
export const checkStorageMove = params => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/checkStorageMove`, { params });
// 移库的打印单数据
export const queryPrintMoveData = transferNo => axios.get(`${SERVER.DMSCLOUD_PART}/partMove/queryPrintMoveData/${transferNo}`);
